package com.heima.article.controller.v1;

import com.heima.article.service.ApArticleService;
import com.heima.model.article.pojos.ApArticle;
import com.heima.model.common.dtos.ResponseResult;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

@Api(value = "APP文章管理API",tags = "APP文章管理API")
@RestController
@RequestMapping("/api/v1/article")
public class ArticleController {
    @Autowired
    ApArticleService articleService;

    @ApiOperation("根据id查询ApArticle信息")
    @GetMapping("/{id}")
    public ResponseResult<ApArticle> findArticleById(@PathVariable("id") Long id) {
        return ResponseResult.okResult(articleService.getById(id));
    }
}
